#ifndef TOOLBOX_H_INCLUDED
#define TOOLBOX_H_INCLUDED

#include "common.h"
#include "box.h"
#include "floor.h"
#include "target.h"
#include "wall.h"
#include "empty.h"

class Toolbox{

    public:
        Toolbox();
        enum ToolboxEvents{STAGE_UP,STAGE_DOWN,NEW_STAGE,SAVE_STAGE,DO,UNDO,CHANGE_NORTH,CHANGE_EAST,CHANGE_SOUTH,CHANGE_WEST,CHANGE_BLOCK,NONE_EVENT};

        ALLEGRO_BITMAP* render();
        int &stage() { return _stage;}
        Toolbox::ToolboxEvents onClick(int x, int y, int button);
        Block* block(){ return _block; }

    private:
        ALLEGRO_BITMAP* _renderImg;
        int _stage;
        Block* imgs_block[5];
        Block* _block;
        int _current_block;
        int dir[4];

        Toolbox::ToolboxEvents onClickStageUp();
        Toolbox::ToolboxEvents onClickStageDown();
        Toolbox::ToolboxEvents onClickNewStage();
        Toolbox::ToolboxEvents onClickSaveStage();

        Toolbox::ToolboxEvents onClickDo();
        Toolbox::ToolboxEvents onClickUndo();
        Toolbox::ToolboxEvents onClickChangeNorth();
        Toolbox::ToolboxEvents onClickChangeEast();
        Toolbox::ToolboxEvents onClickChangeSouth();
        Toolbox::ToolboxEvents onClickChangeWest();
        Toolbox::ToolboxEvents onClickChangeBlock(int);

        void changeDir();
        int nextDir(int);


};

#endif // TOOLBOX_H_INCLUDED
